package com.huaqing.result.impl;

import com.huaqing.result.ResultOperation;
import com.huaqing.result.Result;

/**
 * @program: javatrainingfirstweek
 * @Description:
 * @author: Mr.Cheng
 * @date: 2022/4/17 12:37 上午
 */
public class ResultOperationImpl implements ResultOperation {
    /**
     * @Description: 人机对战-人胜
     * @Param: []
     * @return: com.huaqing.pojo.Result
     * @Author: Mr.Cheng
     * @Date: 2022/4/17 12:34 上午
     */
    @Override
    public Result rockPaperScissorsByPersonWin() {
        Result result = new Result();
        result.setUserWin(result.getUserWin() + 1);
        result.setComputerLosses(result.getComputerLosses() + 1);
        return result;
    }

    /**
     * @Description: 人机对战-电脑胜
     * @Param: []
     * @return: com.huaqing.pojo.Result
     * @Author: Mr.Cheng
     * @Date: 2022/4/17 12:34 上午
     */
    @Override
    public Result rockPaperScissorsByComputerWin() {
        Result result = new Result();
        result.setUserLosses(result.getUserWin() + 1);
        result.setComputerWin(result.getComputerLosses() + 1);
        return result;
    }

    /**
     * @Description: 人机对战-平
     * @Param: []
     * @return: com.huaqing.pojo.Result
     * @Author: Mr.Cheng
     * @Date: 2022/4/17 12:34 上午
     */
    @Override
    public Result rockPaperScissorsByPersonAndComputerDraws() {
        Result result = new Result();
        result.setUserDraws(result.getUserDraws() + 1);
        result.setComputerDraws(result.getComputerDraws() + 1);
        return result;
    }
}
